<?php
include 'common.php';
if (!$_COOKIE['name']) {
	header("location:login.php",302);
	}
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>知趣论坛</title>
	<link href="<?=$website['public'];?>/web/base.css" rel="stylesheet" type="text/css"/>
	<link href="<?=$website['public'];?>/web/published.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="top">
	<div class="auto">
		<div class="nav">
			<img src="<?=$website['public'];?>/web/img/logo.png" style="width:30px; height:25px;margin:13px;" />
			<a href="../index.php">首页</a>
			<a href="discus.php">讨论</a>
			<a href="answers.php">问答</a>
			<a href="node.php">节点</a>
			<a href="">标签</a>
			<input type="text" name="name" placeholder="搜索" autocomplete="off" class="input">
			<div class="login right">
			<?php if ($_COOKIE['name']) { ?>
			<a href="/web/logout.php?logout=1" class="right">退出登录</a>
			<div class="right name">
			<?php echo ($_COOKIE['name']); ?>
			</div>
			<a href="/web/published.php" class="right">发表</a>
			<?php
			} else { ?>
			<a href="/web/login.php" class="right">登录</a>
			<?php
			}
			 ?></div>
		</div>
	</div>
</div>
<div class="margin">
	<div class="auto">
		<div class="margin_left left">
			<form class="am-form" method="post" action="judge/published_if.php" data-dux="form-bind" data-advanced="false" data-callback="formSubmit">
            <div class="am-form-group">
                <select name="node_id">
					<?php 
					$sql = "SELECT * FROM zone ORDER BY id ASC";
					$row = select($sql,$DB);
					foreach ($row as $key => $value) { 
					?>
                    <optgroup label="<?php echo $value['Area'] ?>">
					<?php 
					$sql = "SELECT * FROM version WHERE zone_id = '{$value['id']}'";
					$row = select($sql,$DB);
					foreach ($row as $key => $value) { 
					?>
                            <option value="<?php echo $value['id'] ?>"><?php echo $value['AdvancedEdu'] ?></option>
					<?php } ?>
                    </optgroup>
				<?php } ?>
                </select>
            </div>
            <div class="am-form-group">
                <input type="text" name="title" placeholder="请填写标题">
            </div>
            <div class="am-form-group">
                <div class="dux-topic-editor">
                    <ul class="editor-info">
                        <li>请注意单词拼写，以及中英文排版，<a href="https://github.com/sparanoid/chinese-copywriting-guidelines">参考此页</a>
                        </li>
                        <li>支持 Markdown 格式, <strong>**粗体**</strong>、~~删除线~~、<code>`单行代码`</code>, 更多语法请见这里 <a
                                href="https://github.com/riku/Markdown-Syntax-CN/blob/master/syntax.md">Markdown 语法</a></li>
                        <li>上传图片, 需要上传至图床</li>
                        <li>发布框支持本地存储功能，会在内容变更时保存，「提交」按钮点击时清空</li>
                    </ul>
                    <textarea id="editor" name="content" data-dux="topics-editor"></textarea>
                </div>
            </div>
            <div class="right"><button type="submit" class="am-btn am-btn-success">发布</button></div>
        </form>
		</div>
		<div class="margin_right right">
			<div class="prompting">
				<div class="headings">
					以下类型的信息会污染我们的社区
				</div>
				<ul>
					<li>请传播美好的事物，这里拒绝低俗、诋毁、谩骂等相关信息</li>
					<li>请尽量分享技术相关的话题，谢绝发布社会, 政治等相关新闻</li>
					<li>这里绝对不讨论任何有关盗版软件、音乐、电影如何获得的问题</li>
				</ul>
			</div>
			<div class="prompting">
				<div class="headings">
					在高质量优秀社区的我们
				</div>
				<ul>
					<li>分享生活见闻, 分享知识</li>
					<li>接触新技术, 讨论技术解决方案</li>
					<li>为自己的创业项目找合伙人, 遇见志同道合的人</li>
					<li>自发线下聚会, 加强社交</li>
					<li>发现更好工作机会</li>
					<li>甚至是开始另一个神奇的开源项目</li>
				</ul>
			</div>
		</div>
	</div>
</div>
<div class="bottom">
	© 2016 DuxPHP, Inc. Licensed under 0.0170s
</div>
</body>
</html>